home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / arexx-scripts / arexx-pack / scripti.lha / Scripti / Renamers / RenameToSculpt.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1993-05-19  |  1.1 KB  |  46 lines

  1. /*
  2. ----------------------------------------------------------------------------
  3. Name To Sculpt Sequence
  4. Filenames with the extension .1, .10, .100, .1000
  5.     and with the extension of .0001, .0010, .0100, .1000
  6. Will be renamed with the extension: .0001, .0010, .0100, .1000
  7.  
  8. Host address: COMMAND.
  9. Written by Jan Van Overbeke, 3-DEE, ©1993.
  10. Read the AREXX-Scripti doc, for more info about operation and rights!
  11. ----------------------------------------------------------------------------
  12. */
  13.  
  14. arg source
  15. dest=source
  16. if ~exists(dest)|dest='' then do
  17.     say 'Unable to find file !!'
  18.     say 'See Ya......'
  19.     say ''
  20.     exit
  21.     end
  22.     
  23. exttwopos=lastpos('.',dest)
  24. if ~exttwopos<length(dest)-5 then do
  25.     extnumber=right(dest,length(dest)-exttwopos)
  26.     if (extnumber<0)|(extnumber>9999) then do
  27.         say 'Invalid filename: Wrong extension !!'
  28.         say 'See Ya...'
  29.         say ''
  30.         exit
  31.         end
  32.     dest=delstr(dest,exttwopos+1)||extnumber||'.image'
  33.     say 'Renaming: 'source
  34.     say 'as: 'dest
  35.     say ''
  36.     doscommand='rename >NIL: 'source' as 'dest
  37.     address COMMAND doscommand
  38.     exit
  39.     end
  40.  
  41. say 'Extension too large !!!!'
  42. say 'No longer than 4 digits!'
  43. say 'See Ya...'
  44. say ''
  45. exit
  46.